package com.luoyuanxiangvip.admin.core.utils;

import org.apache.shiro.crypto.hash.SimpleHash;

/**
 * <p>
 * 加密工具
 * </p>
 *
 * @author luoyuanxiang <p>luoyuanxiangvip.com</p>
 * @since 2019/5/27 10:20
 */
public class Sha256Util {

    /**  加密算法 */
    private final static String HASH_ALGORITHM_NAME = "SHA-256";

    /**  循环次数 */
    private final static int HASH_ITERATIONS = 16;

    public static String sha256(String password, String salt) {
        return new SimpleHash(HASH_ALGORITHM_NAME, password, salt, HASH_ITERATIONS).toString();
    }
}
